1. Field of the Invention
The present invention relates to a robot controller for controlling an articulated robot, such as a welding robot and, more particularly, to a robot controller for controlling an articulated robot, capable of controlling the movement of a work gripped by the gripping unit of the articulated robot along a desired locus at a high accuracy.
2. Description of the Prior Art
In an industrial robot having a plurality of degrees of freedom of motion, such as an articulated robot or a polar coordinates robot, the load on each joint shaft varies owing to the variation of the moment of inertia of components according to the mode of action of a plurality of actuators. Since the variation of the moment of inertia of the component affects the response characteristics of a servomechanism associated with each joint shaft, the moment of inertia of the component must be taken into consideration in controlling the industrial robot.
J.P. Pat. Provisional Pub. (Kokai) No. 61-163406 proposes a control system which calculates the variation of the moment of inertia on the basis of the performance of the actuator. FIGS. 4, 5, 6 and 7 illustrate this previously proposed control system.
Referring to FIG. 5, an articulated robot RB has six degrees of freedom of motion, and the component segments of the articulated robot RB are rotatable as indicated by .theta..sub.1 to .theta..sub.6 respectively on joints 1 to 6. These component segments are driven for rotation respectively on the joints 1 to 6 by servomotors M.sub.1 to M.sub.6, not shown in FIG. 5.
Referring to FIG. 6 diagrammatically showing a robot controller for controlling the articulated robot RB of FIG. 5, a CPU (central processing unit) 9 executes operations for providing instructions, analyzing data, calculating instructions and calculating data for position control servomechanisms in accordance with data given thereto by operating a keyboard 8, and gives outputs to servo amplifiers A.sub.1 to A.sub.6. The servo amplifiers A.sub.1 to A.sub.6 give control signals produced by amplifying the outputs of the CPU 9 to the servomotors M.sub.1 to M.sub.6. Photoencoders E.sub.1 to E.sub.6 are combined respectively with the servomotors M.sub.1 to M.sub.6 detect the angles of rotation of the servomotors M.sub.1 to M.sub.6, and then give detection signals representing the angles of rotation to the CPU 9.
Referring to FIG. 7 showing one of the six position control servomechanisms for the joints 1 to 6, a position control servo loop 60 includes a speed control minor servo loop 61. A deviation signal 63 is obtained by subtracting feedback position data 77 fed back through the position control loop 60 from angle instruction data 62 created on the basis of data stored in a memory, not shown, by teaching operations and instructions given by operating the keyboard 8. A block 64 amplifies the deviation signal 63 at a gain of K.sub.p to provide an output position signal 65. Feedback speed data 79 fed back through the speed control minor servo loop 61 is subtracted from the output position signal 65 to obtain a deviation signal 66. The servo amplifier 67 (one of the servo amplifiers A.sub.1 to A.sub.6) amplifies the deviation signal 66 at a gain of K.sub.a to give an amplified output signal 68 to the motor M (one of the servomotors M.sub.1 to M.sub.6). The motor M generates a torque 70 corresponding to a torque constant K.sub.t specified by a block 69. A block 71 integrates the torque 70 with respect to time and divides the integral by the moment of inertia to obtain a rotating speed 72. In FIG. 7, indicated at s is a Laplace operator and at J is a moment of inertia obtained by converting a moment of inertia with respect to the axis of the joint into a moment of inertia with respect to the axis of the shaft of the motor M. A block 73 integrates the rotating speed 72 with respect to time to obtain an angle of rotation 74 of the motor M.
The photoencoder E (one of the photoencoders E.sub.1 to E.sub.6) encodes the rotating speed 72 of the motor M at an encoder gain of K.sub.e to provide an encoder output 75. Although it was presumed in the description with reference to FIG. 6 that the photoencoders E.sub.1 to E.sub.6 are those for detecting the angle of rotation, it is presumed in the description with reference to FIG. 7 for convenience' sake that the photoencoders E.sub.1 to E.sub.6 are those for detecting the rotating speed 72.
A block 76 integrates the encoder output 75 with respect to time to obtain a feedback position data 77, which is fed back to a point before the block 64. A block 78 operates the feedback position data 77 by using a speed gain K.sub.v to provide a feedback speed data 79. In the foregoing processes, viscous resistances are neglected for simplicity.
The moment of inertia J is dependent on joint angles at the joints 2 to 6 and the mass of the work, not shown, held by the articulated robot RB. The influence of the variation of the joint angles at the joints 4, 5 and 6 on the variation of the moment of inertia J is comparatively small as compared with that of other factors. Therefore, in this example, the value of the speed gain K.sub.v is varied according to the joint angles at the joints 2 and 3 and the mass of the work. The range of each of the joint angles .theta..sub.2 and .theta..sub.3 is divided into a plurality of subranges, for example, sixteen subranges, an optimum speed gain K.sub.v0 when the mass of the work is zero, an optimum speed gain Kv.sub.max when the mass of the work corresponds to the maximum allowable weight capacity and the difference .DELTA.K.sub.v between the speed gain Kv.sub.max and the speed gain K.sub.vO are calculated beforehand for each subrange, and the calculated values are stored in a memory, such as a RAM.
Speed gain K.sub.v to be used by the servo loop during the operation of the articulated robot RB is calculated by: EQU K.sub.v =K.sub.v0 +.DELTA.K.sub.v .times.m/M.sub.max ( 1)
where m (kg) is the mass of the work, M.sub.max is the maximum allowable mass capacity, K.sub.v0 is optimum speed gain when m=0, and .DELTA.K.sub.v is the difference between the maximum speed gain when m=M.sub.max and K.sub.v0.
FIG. 4 shows steps of procedure for calculating the values of the speed gain K.sub.v for all the joints and for controlling the articulated robot RB by using the values of speed gain K.sub.v.
Referring to FIG. 4, the mass of the work is measured in step 51. In step 52, the values of speed gain K.sub.v0 and the difference .DELTA.K.sub.v for the joints 3, 4, 5 and 6 are read from the memory, the values of speed gain K.sub.v for the joints 3, 4, 5 and 6 are calculated by using the expression (1), and then the calculated values of speed gain K.sub.v are written in the gain table of the memory.
In step 53, the present subrange of the joint angle .theta..sub.3 is detected. This subrange may be detected by reading a desired angle of movement from the memory or by detecting the present joint angle by the photoencoder E.sub.3. In either manner, the present joint angle is determined during the operation of the articulated robot RB.
In step 54, the values of speed gain K.sub.v0 and difference .DELTA.K.sub.v for the joint 2 corresponding to the detected subrange of the joint angle .theta..sub.3 are read from the table of the memory, the value of speed gain K.sub.v for the joint 2 is calculated by using the expression (1), and then the calculated value is written in the gain table.
Similarly, in step 55, the subrange of the joint angle .theta..sub.2 is detected, the values of speed gain K.sub.v0 and difference .DELTA.K.sub.v for the joint 1 corresponding to the subranges of the joint angles .theta..sub.2 and .theta..sub.3 are read from the table of the memory, the value of speed gain K.sub.v for the joint 1 is calculated by using the expression (1), and then the calculated value of speed gain K.sub.v for the joint 1 is written in the gain table.
Thus, the values of speed gain K.sub.v for all the joints at a specified time are specified. Then, in step 57, the values of speed gain K.sub.v are given together with input data including instructions for robot motions, constants and feedback data to the CPU, the CPU calculates output instructions for the servomechanisms and the calculated output instructions are given to the driving mechanisms. In step 58, a determination is made to see if the instructions are final. These steps are repeated until final instructions are obtained.
The foregoing operation of the conventional robot controller is summarized as follows.
Sets of the amounts of actions (joint angles) of the actuators, namely, the servomotors M.sub.1 to M.sub.6, reference values (K.sub.v0) of speed gain for the position servomechanism and the variation (.DELTA.K.sub.v) of speed gain corresponding to the variation of the mass of the work are stored in the memory, the reference values of speed gain and the variations of speed gain corresponding to the amounts of actions of the actuators detected by the photoencoders E.sub.1 to E.sub.6 are read from the memory upon the detection of the amounts of actions of the actuators, values of speed gain (K.sub.v) corresponding to the moments of inertia (J) of the actuators are calculated on the basis of the data read from the memory, and then outputs for the servomechanisms are calculated on the basis of the calculated values of speed gain to control the servomechanisms for optimum response to the variation of the moments of inertia resulting from changes in the position of the functional components of the articulated robot and in the mass of the work.
However, it is difficult to control the locus of the work at a high accuracy by only controlling speed gain according to the variation of the moment of inertia resulting from variation in the position of the functional components of the articulated robot, because position gain is a significant factor affecting the response of the servomechanisms of the articulated robot.
Furthermore, the stepwise change (discontinuous change) of speed gain by reading the values of speed gain from the tables of the memory causes sudden changes in the values of instructions when the values of speed gain are read from positions near the boundaries of the tables, which adversely affects to the motion of the articulated robot deteriorating the accuracy of the locus of the work.